export default (listeners = {}) => {
  return {
    rules: {
      name: [
        { required: true, message: '项目名称不能为空', trigger: 'blur' },
      ],
    },
    formItems: [
      {
        field: 'projectNo',
        type: 'input',
        label: '项目编号',
        config: {
          maxlength: 30,
        },
      },
      {
        field: 'name',
        type: 'input',
        label: '名称',
        config: {
          maxlength: 30,
        },
      },
      {
        field: 'projectStatus',
        type: 'select',
        options: [],
        label: '项目状态',
        isGroup: true,
        config: {
          clearable: false,
        },
        optionConfig: {
          border: true,
        },
      },
      {
        label: '客户',
        field: 'customerName',
        type: 'custom',
      },
      {
        label: '客户电话',
        field: 'customerPhone',
        type: 'input',
      },
      {
        label: '销售',
        field: 'marketerName',
        type: 'custom',
      },
      {
        label: '维保日期',
        field: 'dateRange',
        type: 'datepicker',
        config: {
          type: 'daterange',
          valueFormat: 'YYYY-MM-DD',
          format: 'YYYY/MM/DD',
          maxlength: 130,
        },
        layout: {
          xl: 12,
          gl: 12,
          md: 12,
          sm: 12,
          xs: 24,
        },
      },
      {
        field: 'status',
        type: 'radio',
        label: '状态',
        isGroup: true,
        options: [],
        config: {
          clearable: false,
        },
        optionConfig: {
          border: true,
        },
      },
      {
        field: 'contractDays',
        type: 'inputNumber',
        label: '合同天数',
        config: {
          maxlength: 30,
        },
      },
      {
        field: 'residueDays',
        type: 'inputNumber',
        label: '剩余天数',
        config: {
          maxlength: 30,
          disabled: true,
        },
      },
      {
        label: '描述',
        field: 'description',
        type: 'textarea',
        config: {
          autosize: { minRows: 5, maxRows: 5 },
        },
        layout: {
          xl: 24,
          gl: 24,
          md: 24,
          sm: 24,
          xs: 24,
        },
      },
    ],
    colLayout: {
      xl: 12,
      gl: 12,
      md: 12,
      sm: 12,
      xs: 24,
    },
    itemStyle: {
      padding: '0px 8px 0px 8px',
    },
    elFormConfig: {
      labelWidth: '80px',
    },
    hideItems: ref([]),
  }
}
